<?php
/**
 * 站内搜索 列表文件
 *
 * @author		Arthur(ArthurXF@gmail.com)
 * @copyright	(c) 2006 by bizeway.com
 * @version		$Id$
 * @package		ArthurXF
 * @subpackage	keywords
 */
require_once('config/config.inc.php');
require_once("class/keywords.class.php");

$objWebInit = new keywords();
//数据库连接参数
$objWebInit->setDBG($arrGPdoDB);
$objWebInit->db();
//smarty参数
$objWebInit->arrGSmarty = $arrGSmarty;

//安装检查
if($arrGMeta['keywords']['name'] === null){
	echo 'BIWEB网站系统站内搜索功能栏目尚未安装，如需安装成配置文件分类，请配置好config/type.inc.php后，<a href=install.php>点击安装</a>，如要使用数据库分类，直接<a href=install.php>点击安装</a>';
	exit;
}

//include 'block/top_index.php';

if ($_SERVER["REQUEST_METHOD"] == "GET"){

	if(empty($_GET['keywords'])) check::AlertExit('对不起，搜索关键词必须填写!',-1);

	$strIP = check::getip();
	$_GET['user_ip'] = $strIP;

	$keywords = $_GET['keywords'];
	$clicktimes = $_GET['clicktimes'];
	$strRecord = $objWebInit->selectDataG('biweb_keywords');


	if($keywords = $strRecord){
		$objWebInit->updateDataG('biweb_keywords',array('clicktimes'=>'clicktimes+1'));
		$objWebInit->saveInfo($_GET,1); //1为修改
	}else{
		$objWebInit->saveInfo($_GET,0); //0为增加
	}
}

//全站公用block
@include '../_block.php';

$objWebInit->output($arrMOutput);
?>